package twu.shubham.library;

import java.util.Scanner;

public class Biblioteca {

    public static void main(String args[])
    {
        int toContinue = 1;
        int menuOption;

       Library Library = new Library();


        System.out.println("Welcome to Library system");

        while (toContinue==1)
        {
            System.out.println("Menu : \n" +
                    "1.See all the books\n" +
                    "2.See all the movies\n" +
                    "3.See the membership detail\n" +
                    "4.Login\n"+
                    " enter an option");
            int bookNumber;
            Scanner input = new Scanner( System.in );
            menuOption = input.nextInt();

            if(menuOption==1)
            {
                  System.out.println(Library.bookPrint());

                System.out.println("Want to reserve a book : 1.Yes\n2.No\n");
                int reserveBook = input.nextInt();

                if(reserveBook==1)
                {
                    System.out.println("Enter the book number : ");
                    bookNumber = input.nextInt();
                    System.out.println(Library.reserveBook(bookNumber));
                }

            }

            if(menuOption==2)
            {
                System.out.println(Library.moviePrint());
            }

            if(menuOption==3)
            {
                System.out.println(Library.getMembershipDetail());
            }

            if(menuOption==4)
            {

                        System.out.println(" Enter Library number : ");
                        int libraryNumber=input.nextInt();
                        System.out.println("Enter Password : ");
                        String password = input.next();
                        System.out.println(Library.Login(libraryNumber, password));


             }


            System.out.println("Do You want to continue : 1.Yes\t2.No\n");
            toContinue=input.nextInt();

        }
    }

}
